# -*- coding: utf-8 -*-
# @Time    : 2021/4/21 20:14
# @Author  : xxue
# @Email   : x_xue1212@163.com
# @File    : 快速排序.py
# @Software: PyCharm

# 快速排序
# def quick_sort(list1):
#     if len(list1) < 2:
#         return list1
#     left, right = [], []
#     min = list1[len(list1)//2]
#     list1.remove(min)
#     for i in list1:
#         if i <= min:
#             left.append(i)
#         else:
#             right.append(i)
#     return quick_sort(left)+[min]+quick_sort(right)
#
# list1 = [68767,4,3,6,24,6,34,7,2,56,235,8,2,-5,231]
# qs = quick_sort(list1)
# print(qs)
#

def quick_sort(lst):
    if len(lst) < 2:
        return lst
    left = []
    right = []
    mid = lst[len(lst) // 2]
    lst.remove(mid)
    for i in lst:
        if i >= mid:
            right.append(i)
        else:
            left.append(i)
    return quick_sort(left) + [mid] + quick_sort(right)


lst = list(input("请任意输入:"))
lst = list(map(int,lst))
print(lst)
qs = quick_sort(lst)
print(qs)
